package vn.vfriends.payment.service.impl;

import java.util.List;
import javax.inject.Inject;
import vn.vfriends.payment.jpa.controller.RoleJpaController;
import vn.vfriends.payment.jpa.entity.Role;
import vn.vfriends.payment.jpa.entity.Role.RoleCode;
import vn.vfriends.payment.service.RoleService;

/**
 *
 * @author tuan@vfriends.vn
 */
public class RoleServiceImpl implements RoleService {

    @Inject private RoleJpaController roleController;
    
    @Override
    public void create(Role role) throws Exception {
        roleController.create(role);
    }

    @Override
    public void edit(Role role) throws Exception {
        roleController.edit(role);
    }

    @Override
    public void destroy(Long id) throws Exception {
        roleController.destroy(id);
    }

    @Override
    public List<Role> findRoles() {
        return roleController.findRoles();
    }

    @Override
    public List<Role> findRoles(int maxResults, int firstResult) {
        return roleController.findRoles(maxResults, firstResult);
    }

    @Override
    public Role findRole(Long id) {
        return roleController.findRole(id);
    }

    @Override
    public Role findRoleByName(String name) {
        return roleController.findRoleByName(name);
    }

    @Override
    public int getRoleCount() {
        return roleController.getRoleCount();
    }

    @Override
    public List<Role> findRolesByUserEmail(String email) {
        return roleController.findRolesByUserEmail(email);
    }

    @Override
    public Role findRoleByCode(RoleCode code) {
        return roleController.findRoleByCode(code);
    }

}
